﻿@model IList<CTM.Web.Models.View.Report.ReportItemViewModel>

@{
    WebGrid gridF = new WebGrid(source: Model, canSort: true, rowsPerPage: (int)ViewBag.PageSize, ajaxUpdateContainerId: "feedback-result", fieldNamePrefix: "ff", pageFieldName: "fp_");
}

@(new HtmlString(
    gridF.GetHtml(tableStyle: "table",
                headerStyle: "webgrid-header",
                mode: WebGridPagerModes.All,
                columns: gridF.Columns(gridF.Column(header: "No", style: "text-right", format: item => item.WebGrid.Rows.IndexOf(item) + 1 + Math.Round(Convert.ToDouble(gridF.TotalRowCount / gridF.PageCount) / gridF.RowsPerPage) * gridF.RowsPerPage * gridF.PageIndex),
                        gridF.Column("Associate", format: @<text>@Html.ActionLink((string)item.Associate, "Index", "Feedback", new { id = item.AssociateId }, null)</text>),
                        gridF.Column("NoMyPost", "My feedbacks", style: "text-right"),
                        gridF.Column("NoOtherPost", "Other's feedbacks", style: "text-right"),
                        gridF.Column("NoSmilePost", "{SmileHeading}", style: "text-right"),
                        gridF.Column("NoFrownPost", "{FrownHeading}", style: "text-right"),
                        gridF.Column("NoNeutralPost", "{NeutralHeading}", style: "text-right"))).ToHtmlString()
                        .Replace("{SmileHeading}", "<span class='label label-success'><span class='fa fa-lg fa-smile-o'></span></span>")
                        .Replace("{FrownHeading}", "<span class='label label-danger'><span class='fa fa-lg fa-frown-o'></span></span>")
                        .Replace("{NeutralHeading}", "<span class='label label-warning'><span class='fa fa-lg fa-meh-o'></span></span>")
                        ))